<?php
	// start the session
	session_start(); 

	// include the s3 class library
  	require_once("class.s3.php");
?> 
<!-- *+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+ -->
<!-- File: Create.php 																							-->
<!--																											-->
<!-- Author: John Fronckowiak, IDC Consulting, Inc.																-->
<!--																											-->
<!-- Purpose: Create a new bucket.																				-->
<!-- *+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+ -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<!-- set the iPhone viewport -->
	<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
	
	<!-- include the iui style sheet and javascript -->
	<style type="text/css" media="screen">@import "lib/iui/iui.css";</style>
    <script type="application/x-javascript" src="lib/iui/iui.js"></script>		

	<title>Amazon Web Services Manager</title>
</head>

<body>
<ul id="create" title="Create Bucket" selected="true">
<?php
	// create an S3 object
  	$s3 = new S3($HTTP_SESSION_VARS["AMAZON_KEY"], $HTTP_SESSION_VARS["AMAZON_PRIVATE_KEY"]);
	
	// retrieve the bucket name
  	$bucket_name = $_POST['bucketName'];

	// create the bucket 
  	if ($s3->createBucket($bucket_name)) {
      echo "<li>$bucket_name has been created.</li>";
  	} else {
      echo "<li>Error creating $bucket_name.</li>";
  	}
?>
</ul>
</body>
</html>